﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;
using nERP.Model.Wms;
using nERP.Model.Bas;

namespace nERP.Model.Wms
{
    /// <summary>
    /// 其他出库明细
    /// </summary>
	[Table("OtherOutWarehouseDetail")]
    [SoftKey(nameof(OtherOutWarehouseDetail.OtherOutWarehouseDetailCode))]
    [Display(Name = "_Model.OtherOutWarehouseDetail")]
    public class OtherOutWarehouseDetail : BasePoco,ITenant
    {
        [Display(Name = "_Model._OtherOutWarehouseDetail._Seq")]
        [Comment("序号")]
        public int? Seq { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._OtherOutWarehouseDetailCode")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("出库明细单号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string OtherOutWarehouseDetailCode { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._OtherOutWarehouse")]
        [Comment("其他出库")]
        [NotMapped]
        public OtherOutWarehouse OtherOutWarehouse { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._OtherOutWarehouse")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("其他出库")]
        public string OtherOutWarehouseId { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._Warehouse")]
        [Comment("仓库")]
        [NotMapped]
        public Warehouse Warehouse { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._Warehouse")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("仓库")]
        public string WarehouseId { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._Goods")]
        [Comment("商品")]
        [NotMapped]
        public Goods Goods { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._Goods")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("商品")]
        public string GoodsId { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._GoodsName")]
        [StringLength(64, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("商品名称")]
        public string GoodsName { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._GoodsSpec")]
        [StringLength(64, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("商品规格")]
        public string GoodsSpec { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._GoodsUnit")]
        [StringLength(32, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("计量单位")]
        public string GoodsUnit { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._OtherOutNumber")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("出库数量")]
        public decimal? OtherOutNumber { get; set; }
        [Display(Name = "_Model._OtherOutWarehouseDetail._Status")]
        [Comment("状态")]
        public dStatusTypeEnum? Status { get; set; } = dStatusTypeEnum.Unaudited;
        [Display(Name = "_Model._OtherOutWarehouseDetail._Remark")]
        [StringLength(256, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("备注")]
        public string Remark { get; set; }
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
